<template>
    <div>
        <button @click="childMethod()">sun件给father组件传递数据和方法</button>
        <div @click="gotoHelloWorld" class="no-component">非父子组件介绍</div>
    
    </div>
</template>
<script>
export default {
    name:'Child',
    data(){
        return{
          toHome:'子组件传递给父组件的数据'
        }
    },
    methods:{
        childMethod() {
            this.$emit('FatherMethod',this.toHome);
        },
        gotoHelloWorld(){
            let pamas = {
                path:'path',
                name:1
            }
            // this.VueEvent.$emit('to-HelloWorld',{...pamas})  
            this.VueEvent.$emit('to-HelloWorld',pamas) 
        }
    }
}
</script>
<style lang="scss" scoped>
.no-component{
    cursor: pointer;
}
</style>